
import 'dart:async';
import 'dart:convert';

import 'package:flutter/services.dart';
import 'package:scankit/model/scan_model.dart';
class Scankit {
  // 创建插件
  static const MethodChannel _channel = MethodChannel('scankit');
  // 定义调用方法
  static Future<ScanModel> loadScanKit() async {
    return await _channel
        .invokeMethod("loadScanKit")
        .then((value) => scanBeanFromJson(json.encode(value)));
  }
  static Future<String?> get platformVersion async {
    final String? version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }
}
